package com.yenlien.traceyun.webase.annotation;

import org.springframework.data.jpa.repository.Query;

import java.lang.annotation.Annotation;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-06-17
 * @description:
 **/

public class Test {

    @Query
    public void test() {

    }

    public static void main(String[] args) throws NoSuchMethodException {
        Test test = new Test();
        Annotation annotation[] = (test.getClass().getDeclaredMethod("test").getDeclaredAnnotations());
        if (annotation != null && annotation.length > 0) {
            for (Annotation annotation1 : annotation) {
                System.out.println(annotation1 instanceof Query);
            }
        }
    }
}
